package csd.wyaiyr.com.model;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.*;

@Table(name = "monitor_data")
public class MonitorData implements Serializable {
    @Id
    private String id;

//  温度
    private BigDecimal temp;

//   湿度
    private BigDecimal humi;

//   上报时间
    @Column(name = "report_time")
    private Date reportTime;

//   告警标志
    @Column(name = "worn_flag")
    private String wornFlag;

//    告警信息

    @Column(name = "worn_info")
    private String wornInfo;

    private static final long serialVersionUID = 1L;

//   @return id

    public String getId() {
        return id;
    }

//   @param id

    public void setId(String id) {
        this.id = id;
    }

//   获取温度

    public BigDecimal getTemp() {
        return temp;
    }

//   设置温度

    public void setTemp(BigDecimal temp) {
        this.temp = temp;
    }

//  获取湿度

    public BigDecimal getHumi() {
        return humi;
    }

//    设置湿度

    public void setHumi(BigDecimal humi) {
        this.humi = humi;
    }

//    获取上报时间

    public Date getReportTime() {
        return reportTime;
    }

//    设置上报时间

    public void setReportTime(Date reportTime) {
        this.reportTime = reportTime;
    }

//   获取告警标志

    public String getWornFlag() {
        return wornFlag;
    }

//  设置告警标志

    public void setWornFlag(String wornFlag) {
        this.wornFlag = wornFlag;
    }

//    获取告警信息
    public String getWornInfo() {
        return wornInfo;
    }

//    设置告警信息

    public void setWornInfo(String wornInfo) {
        this.wornInfo = wornInfo;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        MonitorData other = (MonitorData) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getTemp() == null ? other.getTemp() == null : this.getTemp().equals(other.getTemp()))
            && (this.getHumi() == null ? other.getHumi() == null : this.getHumi().equals(other.getHumi()))
            && (this.getReportTime() == null ? other.getReportTime() == null : this.getReportTime().equals(other.getReportTime()))
            && (this.getWornFlag() == null ? other.getWornFlag() == null : this.getWornFlag().equals(other.getWornFlag()))
            && (this.getWornInfo() == null ? other.getWornInfo() == null : this.getWornInfo().equals(other.getWornInfo()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getTemp() == null) ? 0 : getTemp().hashCode());
        result = prime * result + ((getHumi() == null) ? 0 : getHumi().hashCode());
        result = prime * result + ((getReportTime() == null) ? 0 : getReportTime().hashCode());
        result = prime * result + ((getWornFlag() == null) ? 0 : getWornFlag().hashCode());
        result = prime * result + ((getWornInfo() == null) ? 0 : getWornInfo().hashCode());
        return result;
    }
}